﻿// ReSharper disable ArrangeObjectCreationWhenTypeEvident
// ReSharper disable BuiltInTypeReferenceStyle
// ReSharper disable ConvertToAutoProperty
// ReSharper disable InconsistentNaming
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable PreferConcreteValueOverDefault
// ReSharper disable RedundantNameQualifier
// ReSharper disable SuggestVarOrType_SimpleTypes
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMethodReturnValue.Local
// ReSharper disable UnusedType.Global

// StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient

// <auto-generated/>
#nullable enable annotations
#nullable disable warnings

namespace Microsoft.Extensions.DependencyInjection
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.DependencyInjectionGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public static partial class StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientServiceCollectionExtensions
    {
        public static global::StrawberryShake.IClientBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientStoreAccessor> AddStarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            var serviceCollection = new global::Microsoft.Extensions.DependencyInjection.ServiceCollection();
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp =>
            {
                ConfigureClientDefault(sp, serviceCollection, strategy);
                return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityIdSerializer>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory>>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirectiveQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IStarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<ClientServiceProvider>(sp)));
            return new global::StrawberryShake.ClientBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientStoreAccessor>("StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient", services, serviceCollection);
        }

        private static global::Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureClientDefault(global::System.IServiceProvider parentServices, global::Microsoft.Extensions.DependencyInjection.ServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly)
        {
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IEntityStore, global::StrawberryShake.EntityStore>(services);
            global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.TryAddSingleton<global::StrawberryShake.IOperationStore>(services, sp => new global::StrawberryShake.OperationStore(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IEntityStore>(sp)));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Transport.Http.IHttpConnection>(services, sp =>
            {
                var clientFactory = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Net.Http.IHttpClientFactory>(parentServices);
                return new global::StrawberryShake.Transport.Http.HttpConnection(() => clientFactory.CreateClient("StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient"));
            });
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid>, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.GetHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human>, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.GetHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.StringSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.BooleanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ShortSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IntSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LongSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.FloatSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DecimalSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UrlSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.UUIDSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.IdSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.DateSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalDateSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalDateTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.LocalTimeSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.ByteArraySerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.TimeSpanSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializer, global::StrawberryShake.Serialization.JsonSerializer>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.Serialization.ISerializerResolver>(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::System.Collections.Generic.IEnumerable<global::StrawberryShake.Serialization.ISerializer>>(sp))));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.GetHeroWithFragmentIncludeAndSkipDirectiveResultFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultDataFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationRequestFactory>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.GetHeroWithFragmentIncludeAndSkipDirectiveBuilder>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IOperationExecutor<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>>(services, sp => new global::StrawberryShake.OperationExecutor<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.Transport.Http.IHttpConnection>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationResultBuilder<global::System.Text.Json.JsonDocument, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>>(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IResultPatcher<global::System.Text.Json.JsonDocument>>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.IOperationStore>(sp), strategy));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IResultPatcher<global::System.Text.Json.JsonDocument>, global::StrawberryShake.Json.JsonResultPatcher>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirectiveQuery>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirectiveQuery>(sp));
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.IEntityIdSerializer, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientEntityIdFactory>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient>(services);
            global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IStarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient>(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient>(sp));
            return services;
        }

        private sealed class ClientServiceProvider : System.IServiceProvider, System.IDisposable
        {
            private readonly System.IServiceProvider _provider;
            public ClientServiceProvider(System.IServiceProvider provider)
            {
                _provider = provider;
            }

            public object? GetService(System.Type serviceType)
            {
                return _provider.GetService(serviceType);
            }

            public void Dispose()
            {
                if (_provider is System.IDisposable d)
                {
                    d.Dispose();
                }
            }
        }
    }
}

namespace StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveResult : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirectiveResult>, IGetHeroWithFragmentIncludeAndSkipDirectiveResult
    {
        public GetHeroWithFragmentIncludeAndSkipDirectiveResult(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero? hero)
        {
            Hero = hero;
        }

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero? Hero { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirectiveResult? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((Hero is null && other.Hero is null) || Hero != null && Hero.Equals(other.Hero)));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirectiveResult)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (Hero != null)
                {
                    hash ^= 397 * Hero.GetHashCode();
                }

                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid>, IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid
    {
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid(global::System.String id, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? friends)
        {
            Id = id;
            Friends = friends;
        }

        public global::System.String Id { get; }
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? Friends { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (Id.Equals(other.Id)) && ((Friends is null && other.Friends is null) || Friends != null && Friends.Equals(other.Friends));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                hash ^= 397 * Id.GetHashCode();
                if (Friends != null)
                {
                    hash ^= 397 * Friends.GetHashCode();
                }

                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human>, IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Human
    {
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human(global::System.String id, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? friends)
        {
            Id = id;
            Friends = friends;
        }

        public global::System.String Id { get; }
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? Friends { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (Id.Equals(other.Id)) && ((Friends is null && other.Friends is null) || Friends != null && Friends.Equals(other.Friends));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                hash ^= 397 * Id.GetHashCode();
                if (Friends != null)
                {
                    hash ^= 397 * Friends.GetHashCode();
                }

                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    /// <summary>
    /// A connection to a list of items.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection>, IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection
    {
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo? includedPageInfo, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo? skippedPageInfo)
        {
            IncludedPageInfo = includedPageInfo;
            SkippedPageInfo = skippedPageInfo;
        }

        /// <summary>
        /// Information to aid in pagination.
        /// </summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo? IncludedPageInfo { get; }
        /// <summary>
        /// Information to aid in pagination.
        /// </summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo? SkippedPageInfo { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (((IncludedPageInfo is null && other.IncludedPageInfo is null) || IncludedPageInfo != null && IncludedPageInfo.Equals(other.IncludedPageInfo))) && ((SkippedPageInfo is null && other.SkippedPageInfo is null) || SkippedPageInfo != null && SkippedPageInfo.Equals(other.SkippedPageInfo));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                if (IncludedPageInfo != null)
                {
                    hash ^= 397 * IncludedPageInfo.GetHashCode();
                }

                if (SkippedPageInfo != null)
                {
                    hash ^= 397 * SkippedPageInfo.GetHashCode();
                }

                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo>, IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo
    {
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo(global::System.Boolean hasNextPage)
        {
            HasNextPage = hasNextPage;
        }

        /// <summary>
        /// Indicates whether more edges exist following the set defined by the clients arguments.
        /// </summary>
        public global::System.Boolean HasNextPage { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (global::System.Object.Equals(HasNextPage, other.HasNextPage));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                hash ^= 397 * HasNextPage.GetHashCode();
                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo : global::System.IEquatable<GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo>, IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo
    {
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo(global::System.Boolean hasNextPage)
        {
            HasNextPage = hasNextPage;
        }

        /// <summary>
        /// Indicates whether more edges exist following the set defined by the clients arguments.
        /// </summary>
        public global::System.Boolean HasNextPage { get; }

        public virtual global::System.Boolean Equals(GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo? other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() != GetType())
            {
                return false;
            }

            return (global::System.Object.Equals(HasNextPage, other.HasNextPage));
        }

        public override global::System.Boolean Equals(global::System.Object? obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != GetType())
            {
                return false;
            }

            return Equals((GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo)obj);
        }

        public override global::System.Int32 GetHashCode()
        {
            unchecked
            {
                int hash = 5;
                hash ^= 397 * HasNextPage.GetHashCode();
                return hash;
            }
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirectiveResult
    {
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero? Hero { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IHeroFragment
    {
        public global::System.String Id { get; }
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? Friends { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero : IHeroFragment
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid : IGetHeroWithFragmentIncludeAndSkipDirective_Hero
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Human : IGetHeroWithFragmentIncludeAndSkipDirective_Hero
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// A connection to a list of items.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IFriendsFragment
    {
        /// <summary>
        /// Information to aid in pagination.
        /// </summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo? IncludedPageInfo { get; }
        /// <summary>
        /// Information to aid in pagination.
        /// </summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo? SkippedPageInfo { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// A connection to a list of items.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends : IFriendsFragment
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// A connection to a list of items.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection : IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IPageInfoFragment
    {
        /// <summary>
        /// Indicates whether more edges exist following the set defined by the clients arguments.
        /// </summary>
        public global::System.Boolean HasNextPage { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo : IPageInfoFragment
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo : IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo : IPageInfoFragment
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator
    /// <summary>
    /// Information about pagination in a connection.
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo : IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo
    {
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationDocumentGenerator
    /// <summary>
    /// Represents the operation service of the GetHeroWithFragmentIncludeAndSkipDirective GraphQL operation
    /// <code>
    /// query GetHeroWithFragmentIncludeAndSkipDirective(
    ///   $includePageInfo: Boolean = false
    ///   $skipPageInfo: Boolean = true
    /// ) {
    ///   hero(episode: NEW_HOPE) {
    ///     __typename
    ///     ... HeroFragment
    ///     ... on Droid {
    ///       id
    ///     }
    ///     ... on Human {
    ///       id
    ///     }
    ///   }
    /// }
    /// 
    /// fragment HeroFragment on Character {
    ///   id
    ///   friends {
    ///     __typename
    ///     ... FriendsFragment
    ///   }
    /// }
    /// 
    /// fragment FriendsFragment on FriendsConnection {
    ///   includedPageInfo: pageInfo @include(if: $includePageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    ///   skippedPageInfo: pageInfo @skip(if: $skipPageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    /// }
    /// 
    /// fragment PageInfoFragment on PageInfo {
    ///   hasNextPage
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument : global::StrawberryShake.IDocument
    {
        private GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument()
        {
        }

        public static GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument Instance { get; } = new GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument();
        public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query;
        public global::System.ReadOnlySpan<global::System.Byte> Body => "query GetHeroWithFragmentIncludeAndSkipDirective($includePageInfo: Boolean = false, $skipPageInfo: Boolean = true) { hero(episode: NEW_HOPE) { __typename ... HeroFragment ... on Droid { id } ... on Human { id } } } fragment HeroFragment on Character { id friends { __typename ... FriendsFragment } } fragment FriendsFragment on FriendsConnection { includedPageInfo: pageInfo @include(if: $includePageInfo) { __typename ... PageInfoFragment } skippedPageInfo: pageInfo @skip(if: $skipPageInfo) { __typename ... PageInfoFragment } } fragment PageInfoFragment on PageInfo { hasNextPage }"u8;
        public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("sha1Hash", "87f3c93b0135cfd1f7e0467b57ae1a6ef7d4e828");

        public override global::System.String ToString()
        {
#if NETCOREAPP3_1_OR_GREATER
        return global::System.Text.Encoding.UTF8.GetString(Body);
#else
            return global::System.Text.Encoding.UTF8.GetString(Body.ToArray());
#endif
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationServiceGenerator
    /// <summary>
    /// Represents the operation service of the GetHeroWithFragmentIncludeAndSkipDirective GraphQL operation
    /// <code>
    /// query GetHeroWithFragmentIncludeAndSkipDirective(
    ///   $includePageInfo: Boolean = false
    ///   $skipPageInfo: Boolean = true
    /// ) {
    ///   hero(episode: NEW_HOPE) {
    ///     __typename
    ///     ... HeroFragment
    ///     ... on Droid {
    ///       id
    ///     }
    ///     ... on Human {
    ///       id
    ///     }
    ///   }
    /// }
    /// 
    /// fragment HeroFragment on Character {
    ///   id
    ///   friends {
    ///     __typename
    ///     ... FriendsFragment
    ///   }
    /// }
    /// 
    /// fragment FriendsFragment on FriendsConnection {
    ///   includedPageInfo: pageInfo @include(if: $includePageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    ///   skippedPageInfo: pageInfo @skip(if: $skipPageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    /// }
    /// 
    /// fragment PageInfoFragment on PageInfo {
    ///   hasNextPage
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveQuery : global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery
    {
        private readonly global::StrawberryShake.IOperationExecutor<IGetHeroWithFragmentIncludeAndSkipDirectiveResult> _operationExecutor;
        private readonly global::StrawberryShake.Serialization.IInputValueFormatter _booleanFormatter;
        private readonly global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>> _configure = global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>>.Empty;
        public GetHeroWithFragmentIncludeAndSkipDirectiveQuery(global::StrawberryShake.IOperationExecutor<IGetHeroWithFragmentIncludeAndSkipDirectiveResult> operationExecutor, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _operationExecutor = operationExecutor ?? throw new global::System.ArgumentNullException(nameof(operationExecutor));
            _booleanFormatter = serializerResolver.GetInputValueFormatter("Boolean");
        }

        private GetHeroWithFragmentIncludeAndSkipDirectiveQuery(global::StrawberryShake.IOperationExecutor<IGetHeroWithFragmentIncludeAndSkipDirectiveResult> operationExecutor, global::System.Collections.Immutable.ImmutableArray<global::System.Action<global::StrawberryShake.OperationRequest>> configure, global::StrawberryShake.Serialization.IInputValueFormatter booleanFormatter)
        {
            _operationExecutor = operationExecutor;
            _configure = configure;
            _booleanFormatter = booleanFormatter;
        }

        global::System.Type global::StrawberryShake.IOperationRequestFactory.ResultType => typeof(IGetHeroWithFragmentIncludeAndSkipDirectiveResult);

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery With(global::System.Action<global::StrawberryShake.OperationRequest> configure)
        {
            return new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirectiveQuery(_operationExecutor, _configure.Add(configure), _booleanFormatter);
        }

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery WithRequestUri(global::System.Uri requestUri)
        {
            return With(r => r.ContextData["StrawberryShake.Transport.Http.HttpConnection.RequestUri"] = requestUri);
        }

        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery WithHttpClient(global::System.Net.Http.HttpClient httpClient)
        {
            return With(r => r.ContextData["StrawberryShake.Transport.Http.HttpConnection.HttpClient"] = httpClient);
        }

        public async global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<IGetHeroWithFragmentIncludeAndSkipDirectiveResult>> ExecuteAsync(global::System.Boolean? includePageInfo, global::System.Boolean? skipPageInfo, global::System.Threading.CancellationToken cancellationToken = default)
        {
            var request = CreateRequest(includePageInfo, skipPageInfo);
            foreach (var configure in _configure)
            {
                configure(request);
            }

            return await _operationExecutor.ExecuteAsync(request, cancellationToken).ConfigureAwait(false);
        }

        public global::System.IObservable<global::StrawberryShake.IOperationResult<IGetHeroWithFragmentIncludeAndSkipDirectiveResult>> Watch(global::System.Boolean? includePageInfo, global::System.Boolean? skipPageInfo, global::StrawberryShake.ExecutionStrategy? strategy = null)
        {
            var request = CreateRequest(includePageInfo, skipPageInfo);
            return _operationExecutor.Watch(request, strategy);
        }

        private global::StrawberryShake.OperationRequest CreateRequest(global::System.Boolean? includePageInfo, global::System.Boolean? skipPageInfo)
        {
            var variables = new global::System.Collections.Generic.Dictionary<global::System.String, global::System.Object?>();
            variables.Add("includePageInfo", FormatIncludePageInfo(includePageInfo));
            variables.Add("skipPageInfo", FormatSkipPageInfo(skipPageInfo));
            return CreateRequest(variables);
        }

        private global::StrawberryShake.OperationRequest CreateRequest(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
        {
            return new global::StrawberryShake.OperationRequest(id: GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument.Instance.Hash.Value, name: "GetHeroWithFragmentIncludeAndSkipDirective", document: GetHeroWithFragmentIncludeAndSkipDirectiveQueryDocument.Instance, strategy: global::StrawberryShake.RequestStrategy.Default, variables: variables);
        }

        private global::System.Object? FormatIncludePageInfo(global::System.Boolean? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                return _booleanFormatter.Format(value);
            }
        }

        private global::System.Object? FormatSkipPageInfo(global::System.Boolean? value)
        {
            if (value is null)
            {
                return value;
            }
            else
            {
                return _booleanFormatter.Format(value);
            }
        }

        global::StrawberryShake.OperationRequest global::StrawberryShake.IOperationRequestFactory.Create(global::System.Collections.Generic.IReadOnlyDictionary<global::System.String, global::System.Object?>? variables)
        {
            return CreateRequest(variables!);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.OperationServiceInterfaceGenerator
    /// <summary>
    /// Represents the operation service of the GetHeroWithFragmentIncludeAndSkipDirective GraphQL operation
    /// <code>
    /// query GetHeroWithFragmentIncludeAndSkipDirective(
    ///   $includePageInfo: Boolean = false
    ///   $skipPageInfo: Boolean = true
    /// ) {
    ///   hero(episode: NEW_HOPE) {
    ///     __typename
    ///     ... HeroFragment
    ///     ... on Droid {
    ///       id
    ///     }
    ///     ... on Human {
    ///       id
    ///     }
    ///   }
    /// }
    /// 
    /// fragment HeroFragment on Character {
    ///   id
    ///   friends {
    ///     __typename
    ///     ... FriendsFragment
    ///   }
    /// }
    /// 
    /// fragment FriendsFragment on FriendsConnection {
    ///   includedPageInfo: pageInfo @include(if: $includePageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    ///   skippedPageInfo: pageInfo @skip(if: $skipPageInfo) {
    ///     __typename
    ///     ... PageInfoFragment
    ///   }
    /// }
    /// 
    /// fragment PageInfoFragment on PageInfo {
    ///   hasNextPage
    /// }
    /// </code>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IGetHeroWithFragmentIncludeAndSkipDirectiveQuery : global::StrawberryShake.IOperationRequestFactory
    {
        global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery With(global::System.Action<global::StrawberryShake.OperationRequest> configure);
        global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery WithRequestUri(global::System.Uri requestUri);
        global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery WithHttpClient(global::System.Net.Http.HttpClient httpClient);
        global::System.Threading.Tasks.Task<global::StrawberryShake.IOperationResult<IGetHeroWithFragmentIncludeAndSkipDirectiveResult>> ExecuteAsync(global::System.Boolean? includePageInfo, global::System.Boolean? skipPageInfo, global::System.Threading.CancellationToken cancellationToken = default);
        global::System.IObservable<global::StrawberryShake.IOperationResult<IGetHeroWithFragmentIncludeAndSkipDirectiveResult>> Watch(global::System.Boolean? includePageInfo, global::System.Boolean? skipPageInfo, global::StrawberryShake.ExecutionStrategy? strategy = null);
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ClientGenerator
    /// <summary>
    /// Represents the StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient : global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IStarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient
    {
        private readonly global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery _getHeroWithFragmentIncludeAndSkipDirective;
        public StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery getHeroWithFragmentIncludeAndSkipDirective)
        {
            _getHeroWithFragmentIncludeAndSkipDirective = getHeroWithFragmentIncludeAndSkipDirective ?? throw new global::System.ArgumentNullException(nameof(getHeroWithFragmentIncludeAndSkipDirective));
        }

        public static global::System.String ClientName => "StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient";
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery GetHeroWithFragmentIncludeAndSkipDirective => _getHeroWithFragmentIncludeAndSkipDirective;
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ClientInterfaceGenerator
    /// <summary>
    /// Represents the StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient GraphQL client
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial interface IStarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClient
    {
        global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveQuery GetHeroWithFragmentIncludeAndSkipDirective { get; }
    }
}

namespace StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State
{
    // StrawberryShake.CodeGeneration.CSharp.Generators.EntityTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class DroidEntity
    {
        public DroidEntity(global::System.String id = default !, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? friends = default !)
        {
            Id = id;
            Friends = friends;
        }

        public global::System.String Id { get; }
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? Friends { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.EntityTypeGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class HumanEntity
    {
        public HumanEntity(global::System.String id = default !, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? friends = default !)
        {
            Id = id;
            Friends = friends;
        }

        public global::System.String Id { get; }
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? Friends { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultDataFactoryGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveResultFactory : global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.GetHeroWithFragmentIncludeAndSkipDirectiveResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        private readonly global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid> _getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper;
        private readonly global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human> _getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper;
        public GetHeroWithFragmentIncludeAndSkipDirectiveResultFactory(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid> getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper, global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human> getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
            _getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper = getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper ?? throw new global::System.ArgumentNullException(nameof(getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper));
            _getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper = getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper ?? throw new global::System.ArgumentNullException(nameof(getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper));
        }

        global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult);

        public GetHeroWithFragmentIncludeAndSkipDirectiveResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
        {
            if (snapshot is null)
            {
                snapshot = _entityStore.CurrentSnapshot;
            }

            if (dataInfo is GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo info)
            {
                return new GetHeroWithFragmentIncludeAndSkipDirectiveResult(MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero(info.Hero, snapshot));
            }

            throw new global::System.ArgumentException("GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo expected.");
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero(global::StrawberryShake.EntityId? entityId, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (entityId is null)
            {
                return null;
            }

            if (entityId.Value.Name.Equals("Droid", global::System.StringComparison.Ordinal))
            {
                return _getHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper.Map(snapshot.GetEntity<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity>(entityId.Value) ?? throw new global::StrawberryShake.GraphQLClientException());
            }

            if (entityId.Value.Name.Equals("Human", global::System.StringComparison.Ordinal))
            {
                return _getHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper.Map(snapshot.GetEntity<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity>(entityId.Value) ?? throw new global::StrawberryShake.GraphQLClientException());
            }

            throw new global::System.NotSupportedException();
        }

        global::System.Object global::StrawberryShake.IOperationResultDataFactory.Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot)
        {
            return Create(dataInfo, snapshot);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInfoGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo : global::StrawberryShake.IOperationResultDataInfo
    {
        private readonly global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> _entityIds;
        private readonly global::System.UInt64 _version;
        public GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo(global::StrawberryShake.EntityId? hero, global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> entityIds, global::System.UInt64 version)
        {
            Hero = hero;
            _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds));
            _version = version;
        }

        public global::StrawberryShake.EntityId? Hero { get; }
        public global::System.Collections.Generic.IReadOnlyCollection<global::StrawberryShake.EntityId> EntityIds => _entityIds;
        public global::System.UInt64 Version => _version;

        public global::StrawberryShake.IOperationResultDataInfo WithVersion(global::System.UInt64 version)
        {
            return new GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo(Hero, _entityIds, version);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.JsonResultBuilderGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirectiveBuilder : global::StrawberryShake.OperationResultBuilder<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.Boolean, global::System.Boolean> _booleanParser;
        private readonly global::StrawberryShake.Serialization.ILeafValueParser<global::System.String, global::System.String> _iDParser;
        public GetHeroWithFragmentIncludeAndSkipDirectiveBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult> resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
            _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer));
            ResultDataFactory = resultDataFactory ?? throw new global::System.ArgumentNullException(nameof(resultDataFactory));
            _booleanParser = serializerResolver.GetLeafValueParser<global::System.Boolean, global::System.Boolean>("Boolean") ?? throw new global::System.ArgumentException("No serializer for type `Boolean` found.");
            _iDParser = serializerResolver.GetLeafValueParser<global::System.String, global::System.String>("ID") ?? throw new global::System.ArgumentException("No serializer for type `ID` found.");
        }

        protected override global::StrawberryShake.IOperationResultDataFactory<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirectiveResult> ResultDataFactory { get; }

        protected override global::StrawberryShake.IOperationResultDataInfo BuildData(global::System.Text.Json.JsonElement obj)
        {
            var entityIds = new global::System.Collections.Generic.HashSet<global::StrawberryShake.EntityId>();
            global::StrawberryShake.IEntityStoreSnapshot snapshot = default !;
            global::StrawberryShake.EntityId? heroId = default !;
            _entityStore.Update(session =>
            {
                heroId = Update_IGetHeroWithFragmentIncludeAndSkipDirective_HeroEntity(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "hero"), entityIds);
                snapshot = session.CurrentSnapshot;
            });
            return new GetHeroWithFragmentIncludeAndSkipDirectiveResultInfo(heroId, entityIds, snapshot.Version);
        }

        private global::StrawberryShake.EntityId? Update_IGetHeroWithFragmentIncludeAndSkipDirective_HeroEntity(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet<global::StrawberryShake.EntityId> entityIds)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                return null;
            }

            global::StrawberryShake.EntityId entityId = _idSerializer.Parse(obj.Value);
            entityIds.Add(entityId);
            if (entityId.Name.Equals("Droid", global::System.StringComparison.Ordinal))
            {
                if (session.CurrentSnapshot.TryGetEntity(entityId, out global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity? entity))
                {
                    session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity(Deserialize_NonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "friends"))));
                }
                else
                {
                    session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity(Deserialize_NonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "friends"))));
                }

                return entityId;
            }

            if (entityId.Name.Equals("Human", global::System.StringComparison.Ordinal))
            {
                if (session.CurrentSnapshot.TryGetEntity(entityId, out global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity? entity))
                {
                    session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity(Deserialize_NonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "friends"))));
                }
                else
                {
                    session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity(Deserialize_NonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "id")), Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "friends"))));
                }

                return entityId;
            }

            throw new global::System.NotSupportedException();
        }

        private global::System.String Deserialize_NonNullableString(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                throw new global::System.ArgumentNullException();
            }

            return _iDParser.Parse(obj.Value.GetString()!);
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                return null;
            }

            var typename = obj.Value.GetProperty("__typename").GetString();
            if (typename?.Equals("FriendsConnection", global::System.StringComparison.Ordinal) ?? false)
            {
                return new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData(typename, includedPageInfo: Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "includedPageInfo")), skippedPageInfo: Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "skippedPageInfo")));
            }

            throw new global::System.NotSupportedException();
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                return null;
            }

            var typename = obj.Value.GetProperty("__typename").GetString();
            if (typename?.Equals("PageInfo", global::System.StringComparison.Ordinal) ?? false)
            {
                return new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData(typename, hasNextPage: Deserialize_NonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "hasNextPage")));
            }

            throw new global::System.NotSupportedException();
        }

        private global::System.Boolean Deserialize_NonNullableBoolean(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                throw new global::System.ArgumentNullException();
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                throw new global::System.ArgumentNullException();
            }

            return _booleanParser.Parse(obj.Value.GetBoolean()!);
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? Deserialize_IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(global::System.Text.Json.JsonElement? obj)
        {
            if (!obj.HasValue)
            {
                return null;
            }

            if (obj.Value.ValueKind == global::System.Text.Json.JsonValueKind.Null)
            {
                return null;
            }

            var typename = obj.Value.GetProperty("__typename").GetString();
            if (typename?.Equals("PageInfo", global::System.StringComparison.Ordinal) ?? false)
            {
                return new global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData(typename, hasNextPage: Deserialize_NonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "hasNextPage")));
            }

            throw new global::System.NotSupportedException();
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.DataTypeGenerator
    ///<summary>A connection to a list of items.</summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class FriendsConnectionData
    {
        public FriendsConnectionData(global::System.String __typename, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? includedPageInfo = default !, global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? skippedPageInfo = default !)
        {
            this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename));
            IncludedPageInfo = includedPageInfo;
            SkippedPageInfo = skippedPageInfo;
        }

        public global::System.String __typename { get; }
        ///<summary>Information to aid in pagination.</summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? IncludedPageInfo { get; }
        ///<summary>Information to aid in pagination.</summary>
        public global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? SkippedPageInfo { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.DataTypeGenerator
    ///<summary>Information about pagination in a connection.</summary>
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "0.0.0.0")]
    public partial class PageInfoData
    {
        public PageInfoData(global::System.String __typename, global::System.Boolean? hasNextPage = default !)
        {
            this.__typename = __typename ?? throw new global::System.ArgumentNullException(nameof(__typename));
            HasNextPage = hasNextPage;
        }

        public global::System.String __typename { get; }
        ///<summary>Indicates whether more edges exist following the set defined by the clients arguments.</summary>
        public global::System.Boolean? HasNextPage { get; }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultFromEntityTypeMapperGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper : global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_DroidFromDroidEntityMapper(global::StrawberryShake.IEntityStore entityStore)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
        }

        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid Map(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.DroidEntity entity, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
        {
            if (snapshot is null)
            {
                snapshot = _entityStore.CurrentSnapshot;
            }

            return new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Droid(entity.Id, MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(entity.Friends, snapshot));
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends returnValue = default !;
            if (data.__typename.Equals("FriendsConnection", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection(MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(data.IncludedPageInfo, snapshot), MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(data.SkippedPageInfo, snapshot));
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo returnValue = default !;
            if (data.__typename.Equals("PageInfo", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo(data.HasNextPage ?? throw new global::System.ArgumentNullException());
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo returnValue = default !;
            if (data.__typename.Equals("PageInfo", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo(data.HasNextPage ?? throw new global::System.ArgumentNullException());
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.ResultFromEntityTypeMapperGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class GetHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper : global::StrawberryShake.IEntityMapper<global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity, GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human>
    {
        private readonly global::StrawberryShake.IEntityStore _entityStore;
        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_HumanFromHumanEntityMapper(global::StrawberryShake.IEntityStore entityStore)
        {
            _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore));
        }

        public GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human Map(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.HumanEntity entity, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null)
        {
            if (snapshot is null)
            {
                snapshot = _entityStore.CurrentSnapshot;
            }

            return new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Human(entity.Id, MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(entity.Friends, snapshot));
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.FriendsConnectionData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends returnValue = default !;
            if (data.__typename.Equals("FriendsConnection", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_FriendsConnection(MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(data.IncludedPageInfo, snapshot), MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(data.SkippedPageInfo, snapshot));
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo returnValue = default !;
            if (data.__typename.Equals("PageInfo", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_IncludedPageInfo_PageInfo(data.HasNextPage ?? throw new global::System.ArgumentNullException());
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }

        private global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo? MapIGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo(global::StrawberryShake.CodeGeneration.CSharp.Integration.StarWarsGetHeroWithFragmentIncludeAndSkipDirective.State.PageInfoData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot)
        {
            if (data is null)
            {
                return null;
            }

            IGetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo returnValue = default !;
            if (data.__typename.Equals("PageInfo", global::System.StringComparison.Ordinal))
            {
                returnValue = new GetHeroWithFragmentIncludeAndSkipDirective_Hero_Friends_SkippedPageInfo_PageInfo(data.HasNextPage ?? throw new global::System.ArgumentNullException());
            }
            else
            {
                throw new global::System.NotSupportedException();
            }

            return returnValue;
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.EntityIdFactoryGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientEntityIdFactory : global::StrawberryShake.IEntityIdSerializer
    {
        private static readonly global::System.Text.Json.JsonWriterOptions _options = new global::System.Text.Json.JsonWriterOptions()
        {
            Indented = false
        };
        public global::StrawberryShake.EntityId Parse(global::System.Text.Json.JsonElement obj)
        {
            global::System.String __typename = obj.GetProperty("__typename").GetString()!;
            return __typename switch
            {
                "Droid" => ParseDroidEntityId(obj, __typename),
                "Human" => ParseHumanEntityId(obj, __typename),
                _ => throw new global::System.NotSupportedException()};
        }

        public global::System.String Format(global::StrawberryShake.EntityId entityId)
        {
            return entityId.Name switch
            {
                "Droid" => FormatDroidEntityId(entityId),
                "Human" => FormatHumanEntityId(entityId),
                _ => throw new global::System.NotSupportedException()};
        }

        private global::StrawberryShake.EntityId ParseDroidEntityId(global::System.Text.Json.JsonElement obj, global::System.String type)
        {
            return new global::StrawberryShake.EntityId(type, obj.GetProperty("id").GetString()!);
        }

        private global::System.String FormatDroidEntityId(global::StrawberryShake.EntityId entityId)
        {
            using var writer = new global::StrawberryShake.Internal.ArrayWriter();
            using var jsonWriter = new global::System.Text.Json.Utf8JsonWriter(writer, _options);
            jsonWriter.WriteStartObject();
            jsonWriter.WriteString("__typename", entityId.Name);
            jsonWriter.WriteString("id", (global::System.String)entityId.Value);
            jsonWriter.WriteEndObject();
            jsonWriter.Flush();
            return global::System.Text.Encoding.UTF8.GetString(writer.GetInternalBuffer(), 0, writer.Length);
        }

        private global::StrawberryShake.EntityId ParseHumanEntityId(global::System.Text.Json.JsonElement obj, global::System.String type)
        {
            return new global::StrawberryShake.EntityId(type, obj.GetProperty("id").GetString()!);
        }

        private global::System.String FormatHumanEntityId(global::StrawberryShake.EntityId entityId)
        {
            using var writer = new global::StrawberryShake.Internal.ArrayWriter();
            using var jsonWriter = new global::System.Text.Json.Utf8JsonWriter(writer, _options);
            jsonWriter.WriteStartObject();
            jsonWriter.WriteString("__typename", entityId.Name);
            jsonWriter.WriteString("id", (global::System.String)entityId.Value);
            jsonWriter.WriteEndObject();
            jsonWriter.Flush();
            return global::System.Text.Encoding.UTF8.GetString(writer.GetInternalBuffer(), 0, writer.Length);
        }
    }

    // StrawberryShake.CodeGeneration.CSharp.Generators.StoreAccessorGenerator
    [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")]
    public partial class StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientStoreAccessor : global::StrawberryShake.StoreAccessor
    {
        public StarWarsGetHeroWithFragmentIncludeAndSkipDirectiveClientStoreAccessor(global::StrawberryShake.IOperationStore operationStore, global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer entityIdSerializer, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationRequestFactory> requestFactories, global::System.Collections.Generic.IEnumerable<global::StrawberryShake.IOperationResultDataFactory> resultDataFactories) : base(operationStore, entityStore, entityIdSerializer, requestFactories, resultDataFactories)
        {
        }
    }
}


